package com.feng.fengDUtil.dao.converter.impl;


import com.feng.fengDUtil.dao.converter.Converter;

import java.io.ByteArrayInputStream;
import java.io.Reader;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class BlobDefaultConverter extends Converter {
    public BlobDefaultConverter() {
    }

    public void serialize(PreparedStatement ps, int clolumnIndex) {
        Object param = this.getSerializeParam();
        if (param != null) {
            if (param instanceof byte[]) {
                byte[] data = (byte[])((byte[])this.getSerializeParam());

                try {
                    ByteArrayInputStream bis = new ByteArrayInputStream(data);
                    ps.setBinaryStream(clolumnIndex, bis, data.length);
                } catch (SQLException var6) {
                    var6.printStackTrace();
                }

            }
        }
    }

    public Object deSerialize(Reader dbValue) {
        return null;
    }

    public static void main(String[] args) {
        System.out.println("a".getBytes() instanceof byte[]);
    }
}